﻿using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Input;

namespace MyFloridaHouse.libSvOpenDistricts.Dialogs
{
    public partial class PlanInfoDlgView : UserControl
    {
        public PlanInfoDlgView()
        {
            InitializeComponent();
        }

        // HOWEVER, we need to set the binding explictly  since the default only updates the ViewModel
        // if you tab out of the districtCount text field.  We want the update for any data
        // entry so that the OK button can be enabled as soon as a valid number is typed
        private void txtBxDistrictCount_KeyUp(object sender, KeyEventArgs e)
        {
            BindingExpression expr = txtBx_DistrictCount.GetBindingExpression(TextBox.TextProperty);
            expr.UpdateSource();
        }
    }
}
